package user

import (
	"gitee.com/gao-deguang/easy-chat/apps/im/ws/internal/svc"
	websocketx "gitee.com/gao-deguang/easy-chat/apps/im/ws/websocket"
)

func Online(svr *svc.ServiceContext) websocketx.HandleFunc {
	return func(srv *websocketx.Server, conn *websocketx.Conn, msg *websocketx.Message) {
		uids := srv.GetUsers()
		//srv.Logger.Infof("*********uids:%v", uids)
		u := srv.GetUsers(conn)

		err := srv.Send(websocketx.NewMessage(u[0], uids), conn)
		srv.Info("err:", err)

	}
}
